<!DOCTYPE html>
<html>
    <head lang="en">
        <meta charset="UTF-8">
    </head>
    <style>
        [id*div]{/*包含*/
            color: aquamarine
        }
        [id^=div]{/*首字符*/
            color:red;
        }
        [id$=y]{/*结束字符*/


            color: blue
        }
    
    </style>
    <body>
        <div id="mydiv1"></div>
        <div id="div2"></div>
        <div id="div3"></div>
        <div id="div4"></div>
        <div id="my"></div>
    </body>
</html>